/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
Ext.define('Nothing.model.User', {
    extend: 'Ext.data.Model',

    idProperty: 'id',
    fields: [
        'username',
        'realname',
        'phone',
        'email',
        'enabled',
        'locked',
        // { name: 'lockedTime', type: 'date', dateFormat: 'Y-m-d', persist: false},
        { name: 'lockedTime', type: 'date', dateFormat: 'time', persist: false}, // dateFormat 指定 server dateFormat

        // 多对多
        // 仅用于展示
        { name: 'rolenames', mapping: 'roles', transformIf: 'name', transformDelimiter: ',' },

        // 用于提交
        { name: 'roleIds', mapping: 'roles', transformIf: 'id' }
    ]
});
